$ rlwrap ./target/debug/console Welcome to O-CPS Interpreter v0.12.0! > f:{[x;y]$[0=x;1+y;$[0=y;f[x-1;1];f[x-1;f[x;y-1]]]]};f[3;6] 509 fn ackerman_k(b: &mut Bencher) { let mut i = Interpreter::new().unwrap(); let ack = i.parse(&"f:{[x;y]$[0=x;1+y;$[0=y;f[x-1;1];f[x-1;f[x;y-1]]]]}".to_string()); i.run(ack).unwrap(); let call = i.parse(&"f[3;4]".to_string()); b.iter(|| { i.run(call); }) } fn ack(m: isize, n: isize) -> isize { if m == 0 { n + 1 } else if n == 0 { ack(m - 1, 1) } else { ack(m - 1, ack(m, n - 1)) } } #[bench] fn ackerman_rust(b: &mut Bencher) { b.iter(|| { ack(3,4) }) } test ackerman_k ... bench: 77,385 ns/iter (+/- 18,011) test ackerman_rust ... bench: 12,483 ns/iter (+/- 7,698) $ cat ack.lua function ack(m,n) if m == 0 then return n + 1 else if n == 0 then return ack(m-1, 1) else return ack(m-1, ack(m, n-1)) end end end local x = os.clock() local f = 0 for i=0,1000000,1 do f = ack(3,4) end print(f,(os.clock()-x)*1000000) $ luajit ack.lua 125 40721830